package com.juyu.miliao.api.util;

/**
 * @author xuanqicheng
 * @create 2019-14-15:33
 */
public class PageInfoUtil {

    private Integer page;

    private Integer pageSize;

    public PageInfoUtil(Integer page, Integer pageSize) {
        this.page = page;
        this.pageSize = pageSize;
    }

    public Integer getPage() {
        return page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public PageInfoUtil invoke() {
        if (pageSize <= 0) {
            pageSize = 20;
        }

        if (page <= 0) {
            page = 1;
        }
        return this;
    }

}
